package com.hk.web.domain.entity;

import com.hk.commons.domain.entity.IdEntity;
import com.hk.commons.enums.AuthMenuType;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import javax.persistence.*;

/**
 * Created by Antinomy on 17/7/26.
 */
@Entity
@DynamicInsert
@DynamicUpdate
@EntityListeners(AuditingEntityListener.class)
public class RoleAssignMenu extends IdEntity {

    @Column(columnDefinition = "bigint(22) NOT NULL comment '角色ID'")
    private Long roleId;

    @Column(columnDefinition = "bigint(22) NOT NULL comment '权限菜单ID'")
    private Long menuId;

    @Column(columnDefinition = "varchar(100) NOT NULL comment '唯一ID'")
    private String uniqueId;

    @Column(columnDefinition = "varchar(40) NOT NULL comment '菜单类型' ")
    @Enumerated(EnumType.STRING)
    private AuthMenuType menuType;

    @Column(columnDefinition = "varchar(50) comment '父菜单Id'")
    private Long parentId;

    public Long getRoleId() {
        return roleId;
    }

    public void setRoleId(Long roleId) {
        this.roleId = roleId;
    }

    public Long getMenuId() {
        return menuId;
    }

    public void setMenuId(Long menuId) {
        this.menuId = menuId;
    }


    public String getUniqueId() {
        return uniqueId;
    }

    public void setUniqueId(String uniqueId) {
        this.uniqueId = uniqueId;
    }

    public AuthMenuType getMenuType() {
        return menuType;
    }

    public void setMenuType(AuthMenuType menuType) {
        this.menuType = menuType;
    }

    public Long getParentId() {
        return parentId;
    }

    public void setParentId(Long parentId) {
        this.parentId = parentId;
    }
}
